package com.sanctuary.tools;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.json.simple.JSONValue;

import com.sanctuary.interfaces.SolrResponseHandler;
import com.sanctuary.models.SolrResponse;

public class JsonSolrHandler implements SolrResponseHandler {
	private static final Log LOG = LogFactory.getLog(JsonSolrHandler.class);
	
	public SolrResponse process(String in) throws Exception {
		Object json = null;
		try {
			json = JSONValue.parse(in);
		} catch (Exception ex) {
			LOG.warn("Something happened when trying to parse JSON input:");
			LOG.warn(StringTools.getStackTrace(ex));
		}
		/*
		 * {"response":{"start":0,"docs":[{"timestamp":"2008-07-16T03:30:48.058Z","id":"6","cat":["Politics"],"weight":100,"term":"John McCain","score":2.3463197}],"maxScore":2.3463197,"numFound":1},"responseHeader":{"status":0,"QTime":0,"params":{"facet":"true","fl":"*,score","facet.mincount":"1","q":"John McCain","facet.field":"cat","wt":"json"}},"facet_counts":{"facet_queries":{},"facet_fields":{"cat":["Politics",1]}}}
		 */
		return null;
	}

}
